<?php
if(!class_exists('XARRecord', false)){
	require_once(XFRAMEWORK_DIR.'/module/active_record/XARRecord.php');
}
class XARShardRecord extends XARRecord{
	public function __construct() {
		$this->dao = XARShardDAO::dao(get_class($this));
	}
	
	/**
	 * @return XARShardQuery
	 */
	public function getQuery() {
		return new XARShardQuery(get_class($this));
	}
	
	public function shardId(){
		return $this->dao()->shardId();
	}
		
	public function shard(XAnnotation $annotations, $value){
		return $this->dao()->strategy()->shard($annotations, $value);
	}
	
	public function allShards(XAnnotation $annotations){
		return $this->dao()->strategy()->allShards($annotations);		
	}
}
?>